1. Field
One or more embodiments of the present invention relate to a method and apparatus for operating an embedded system and, more particularly, to an apparatus for managing memory in a real-time embedded system and a method of allocating, deallocating and managing memory in a real-time embedded system for operating the embedded system in real time.
2. Description of the Related Art
An embedded system is a special-purpose computer system designed to perform one or a few dedicated tasks with limited resources. In the case of a mobile phone as a typical example of the embedded system, the limited resources refer to the size of the mobile phone, the memory capacity and the battery capacity, and the dedicated task refers to call processing for communications.
Embedded systems need to be efficiently managed and operated due to their limited resources. Among these limited resources, memory is used in most tasks and therefore needs to be particularly efficiently managed.
Garbage collection is a form of automatic memory management in the embedded system. It refers to the detection and pruning of unused data structures. This helps to reduce the time needed to access data.
Garbage collection is generally performed when data is stored, deleted or updated in memory. However, if garbage collection is performed whenever data varies, a system can only be used after the data is reorganized. Therefore, garbage collection cannot be adapted to a real-time system which is required to respond quickly after data is created.
In order to solve the above-mentioned problem, one method has been proposed which uses a memory flag to perform garbage collection only when a system is in an idle mode. With this method users do not need to wait long since the data is reorganized in the idle mode when memory is not used. However, this method is not appropriate for memory-consuming tasks or multitasking systems requiring real-time processing.